#include "histogramdialog.h"
#include "ui_histogramdialog.h"

HistogramDialog::HistogramDialog(QDialog *parent, MainApp *_app) : QDialog(parent), ui(new Ui::HistogramDialog)
{
    ui->setupUi(this);
    m_MainApp = _app;
}

HistogramDialog::~HistogramDialog()
{
    delete ui;
}

void HistogramDialog::SetHistogramR(QImage* _hist)
{
    ui->label->setPixmap(QPixmap::fromImage((*_hist)));
}

void HistogramDialog::SetHistogramG(QImage* _hist)
{
    ui->label_2->setPixmap(QPixmap::fromImage((*_hist)));
}

void HistogramDialog::SetHistogramB(QImage* _hist)
{
    ui->label_3->setPixmap(QPixmap::fromImage((*_hist)));
}

void HistogramDialog::on_pushButton_clicked()
{
    m_MainApp->ModifyImgByHistogram(ui->lineEdit->text().toInt(), ui->lineEdit_2->text().toFloat());
    hide();
}
